package animation.wlh.com.animation_demo.basic

import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.animation.TranslateAnimation
import animation.wlh.com.animation_demo.R
import kotlinx.android.synthetic.main.activity_translate.*

/**
 * Created by weilh on 2016/1/22.
 */
class TranslateAct : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_translate)
        title = "平移动画"
        var anim = TranslateAnimation(100f, 0f, 0f, 0f);
        anim.duration = 2000;
        view.setOnClickListener {
           view.startAnimation(anim)
        }
    }
}